package com.ybxx.base.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.ybxx.core.model.BaseModel;
import com.ybxx.system.model.User;

@Entity
@Table(name="tbl_base_community")
public class Community extends BaseModel {
	@Id
	private String cid;
	//楼栋规则
	@ManyToOne(targetEntity=Rule.class,fetch=FetchType.LAZY)
	@JoinColumn(name="crcode",referencedColumnName="rcode") 
	private Rule crule;
	//单元规则
	@ManyToOne(targetEntity=Rule.class,fetch=FetchType.LAZY)
	@JoinColumn(name="urcode",referencedColumnName="rcode") 
	private Rule urule;
	//层数规则
	@ManyToOne(targetEntity=Rule.class,fetch=FetchType.LAZY)
	@JoinColumn(name="lrcode",referencedColumnName="rcode") 
	private Rule lrule;
	//户数规则
	@ManyToOne(targetEntity=Rule.class,fetch=FetchType.LAZY)
	@JoinColumn(name="rrcode",referencedColumnName="rcode") 
	private Rule rrule;
	//管理费规则
	@ManyToOne(targetEntity=ChargeRule.class,fetch=FetchType.LAZY)
	@JoinColumn(name="glcrid",referencedColumnName="crid") 
	private ChargeRule glrule;
	//房费规则
	@ManyToOne(targetEntity=ChargeRule.class,fetch=FetchType.LAZY)
	@JoinColumn(name="rcrid",referencedColumnName="crid") 
	private ChargeRule roomrule;
	private String cname;
	private String caddr;
	private String person;
	private String tel;
	private String state;
	private String content;
	private String cnum;
	private String unum;
	private String lnum;
	private String rnum;
	private String buildingcharge;
	private String bccontent;
	private String glprice;
	private String glcontent;
	private String hmonth;
	private String hprice;
	private String hcontent;
	private String rprice;
	private String rcontent;
	
	@OneToMany(targetEntity=Ban.class,cascade={CascadeType.ALL},mappedBy="community",fetch = FetchType.LAZY)
	private Set<Ban> bans=new HashSet<Ban>();

	public String getCid() {
		return cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}

	public Rule getCrule() {
		return crule;
	}

	public void setCrule(Rule crule) {
		this.crule = crule;
	}

	public Rule getUrule() {
		return urule;
	}

	public void setUrule(Rule urule) {
		this.urule = urule;
	}

	public Rule getLrule() {
		return lrule;
	}

	public void setLrule(Rule lrule) {
		this.lrule = lrule;
	}

	public Rule getRrule() {
		return rrule;
	}

	public void setRrule(Rule rrule) {
		this.rrule = rrule;
	}

	public ChargeRule getGlrule() {
		return glrule;
	}

	public void setGlrule(ChargeRule glrule) {
		this.glrule = glrule;
	}

	public ChargeRule getRoomrule() {
		return roomrule;
	}

	public void setRoomrule(ChargeRule roomrule) {
		this.roomrule = roomrule;
	}

	public String getCname() {
		return cname;
	}

	public void setCname(String cname) {
		this.cname = cname;
	}

	public String getCaddr() {
		return caddr;
	}

	public void setCaddr(String caddr) {
		this.caddr = caddr;
	}

	public String getPerson() {
		return person;
	}

	public void setPerson(String person) {
		this.person = person;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getCnum() {
		return cnum;
	}

	public void setCnum(String cnum) {
		this.cnum = cnum;
	}

	public String getUnum() {
		return unum;
	}

	public void setUnum(String unum) {
		this.unum = unum;
	}

	public String getLnum() {
		return lnum;
	}

	public void setLnum(String lnum) {
		this.lnum = lnum;
	}

	public String getRnum() {
		return rnum;
	}

	public void setRnum(String rnum) {
		this.rnum = rnum;
	}

	public String getBuildingcharge() {
		return buildingcharge;
	}

	public void setBuildingcharge(String buildingcharge) {
		this.buildingcharge = buildingcharge;
	}

	public String getBccontent() {
		return bccontent;
	}

	public void setBccontent(String bccontent) {
		this.bccontent = bccontent;
	}

	public String getGlprice() {
		return glprice;
	}

	public void setGlprice(String glprice) {
		this.glprice = glprice;
	}

	public String getGlcontent() {
		return glcontent;
	}

	public void setGlcontent(String glcontent) {
		this.glcontent = glcontent;
	}

	public String getHmonth() {
		return hmonth;
	}

	public void setHmonth(String hmonth) {
		this.hmonth = hmonth;
	}

	public String getHprice() {
		return hprice;
	}

	public void setHprice(String hprice) {
		this.hprice = hprice;
	}

	public String getHcontent() {
		return hcontent;
	}

	public void setHcontent(String hcontent) {
		this.hcontent = hcontent;
	}

	public String getRprice() {
		return rprice;
	}

	public void setRprice(String rprice) {
		this.rprice = rprice;
	}

	public String getRcontent() {
		return rcontent;
	}

	public void setRcontent(String rcontent) {
		this.rcontent = rcontent;
	}

	public Set<Ban> getBans() {
		return bans;
	}

	public void setBans(Set<Ban> bans) {
		this.bans = bans;
	}
	
	
	
}
